<template>
  <!-- 品牌详情 -->
  <div>
    <van-nav-bar title="专题商品" left-arrow @click-left="$router.back()" />
    <div class="bannar">
      <van-image width="100%" lazy-load :src="info.list_pic_url">
        <template v-slot:loading>
          <van-loading type="spinner" color="#1989fa" size="24" />
        </template>
      </van-image>
      <div class="name">{{ info.name }}</div>
    </div>
    <p class="desc">{{ info.simple_desc }}</p>
  </div>
</template>

<script>
import { getBrandInfo } from '@/api/home'
export default {
  name: 'brandDetail',
  props: ['id'],
  data () {
    return {
      info: {},
      mapQuery: {
        page: 1,
        size: 10,
        brandId: this.id
      }
    }
  },
  created () {
    this.getInfo()
  },
  methods: {
    async getInfo () {
      const res = await getBrandInfo({ id: this.id })
      this.info = res.data.brand
    }
  }
}
</script>

<style scoped lang='less'>
.bannar {
  width: 100%;
  position: relative;
  background-color: #fff;
  .name {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    text-align: center;
    width: 100%;
    height: 0.3rem;
    line-height: 0.3rem;
    text-decoration: underline;
    color: #fff;
    margin: auto;
  }
}
.desc {
  padding: 0.2rem 0.1rem;
  color: #666;
  font-size: 0.18rem;
  line-height: 0.26rem;
  text-align: center;
}
/deep/.van-nav-bar {
  background-color: @red;
  .van-nav-bar__title {
    color: #fff !important;
  }
  .van-icon {
    color: #fff;
  }
}
</style>
